package com.fjnu.config;


import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

import java.sql.Connection;
import java.sql.DriverManager;

@Configuration
@PropertySource("db.properties")
public class JDBCConfig
{

    @Value("${mysql.driver}")
    private String driver ;
    @Value("${mysql.url}")
    private String url ;
    @Value("${mysql.user}")
    private String user ;
    @Value("${mysql.password}")
    private String password ;


//    @Bean  // target at Method type
//    public Connection connection() {
//
//        try {
//            Class.forName(driver) ;
//            return DriverManager.getConnection(url,user,password) ;
//
//
//        } catch (Exception e) {
//
//        }
//        return null ;
//    }

}
